@extends('shopWx.global')

@section('content')
<div class="page page-current" id="payment-stripe">
    <header class="bar bar-nav">
        <a class="icon icon-left pull-left back" style="font-size: 0.8rem">戻る</a>
        <h1 class="title">お支払</h1>
    </header>
    <div class="content check-content" id="page-data" data-url="{{ action('Shop\DealController@getCheckAjax') }}">
        <div class="content-block-title">配達情報</div>
        <p style="margin: 1rem 0.75rem">{{ $order->address }}</p>
        @if(is_string($order->orderList))
            <p style="margin: 1rem 0.75rem">{{ $order->orderList }}</p>
        @else
            <div class="list-block">
                <ul>
                    @foreach($order->orderList as $v)
                    <li class="item-content">
                        @if($v->thumb)<div class="item-media"><img style="width: 1.5rem;" src="{{ action('ImgController@getPicture', ['sourceName' => $v->thumb, 'size' => '110x90']) }}"></div>@endif
                        <div class="item-inner">
                            <div class="item-title">{{ $v->title }}</div>
                            <div class="item-after">{{ isset($v->discount) ? $v->discount.' OFF' : round($v->num * $v->price, 1).' 円' }}</div>
                        </div>
                    </li>
                    @endforeach
                </ul>
            </div>
        @endif
        <div class="content-block-title">クレジットカード</div>
        <div class="list-block">
            <ul>
                <form action="/charge" method="post" id="payment-form">
                    {!! csrf_field() !!}
                    <input type="hidden" name="url" value="{{ action('Shop\DealController@postPayStripe') }}">
                    <input type="hidden" name="code" value="{{ $order->orderNumber }}">
                    <div class="form-row">
                        <div id="card-element">
                            <!-- a Stripe Element will be inserted here. -->
                        </div>

                        <!-- Used to display form errors -->
                        <div id="card-errors" role="alert"></div>
                    </div>
                </form>
            </ul>
        </div>
        <div class="content-block">
            <p><a href="#" class="button button-big button-fill button-success" style="color: #000000" id="stripeSubmit">お支払確定  {{ $order->amount }} 円 </a></p>
        </div>
    </div>
</div>
@endsection